package com.stars.home.adapter


import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.qmuiteam.qmui.kotlin.onClick
import com.stars.home.R
import com.stars.home.databinding.ItemSetUpBinding
import com.stars.home.model.MsgList
import com.stars.home.model.ServiceList
import com.stars.home.vmodel.SetUpVModel
import com.trailer.base.base.BAdapter


class SetUpAdapter() : BAdapter<ServiceList, BaseDataBindingHolder<ItemSetUpBinding>>(R.layout.item_set_up) {

    override fun convert(holder: BaseDataBindingHolder<ItemSetUpBinding>, item: ServiceList) {
        holder.dataBinding?.item = item

        if(item.enable=="1"){
            holder.dataBinding?.imgSwitch?.setImageResource(R.drawable.me_set_on)
        }else{
            holder.dataBinding?.imgSwitch?.setImageResource(R.drawable.me_set_off)

        }
//        holder.dataBinding?.imgSwitch?.onClick {
//            if(item.enable=="0"){
//                item.enable=="1"
//                holder.dataBinding?.imgSwitch?.setImageResource(R.drawable.me_set_on)
//
//            }else{
//                item.enable=="0"
//                holder.dataBinding?.imgSwitch?.setImageResource(R.drawable.me_set_off)
//
//            }
//        }



    }
}
